package models.admin;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.hibernate.envers.Audited;

import play.db.jpa.Model;

/**
 * @author rjanixz
 *
 */
@Entity
@Audited
@Table(uniqueConstraints={@UniqueConstraint(columnNames={"pageId","permissionId"})})
public class PagePermission extends Model {

	@ManyToOne
	@JoinColumn(name="pageId")
	private Page page;
	@ManyToOne
	@JoinColumn(name="permissionId")
	private Permission permission;
	
	public Page getPage() {
		return page;
	}
	
	public void setPage(Page page) {
		this.page = page;
	}
	
	public Permission getPermission() {
		return permission;
	}
	
	public void setPermission(Permission permission) {
		this.permission = permission;
	}
	
	
}
